package com.payment.system.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.payment.common.base.AjaxResult;
import com.payment.system.domain.MoneyChange;
import com.payment.system.domain.PaymentOrder;
import com.payment.system.vo.MoneyChangeNewOederVo;
import com.payment.system.vo.MoneyChangeVo;

/**
 * 资金变动 服务层
 * 
 * @author payment
 * @date 2019-01-08
 */
public interface IMoneyChangeService 
{
	/**
     * 查询资金变动信息
     * 
     * @param iD 资金变动ID
     * @return 资金变动信息
     */
	public MoneyChange selectMoneyChangeById(String id);
	
	/**
     * 查询资金变动列表
     * 
     * @param moneyChange 资金变动信息
     * @return 资金变动集合
     */
	public List<MoneyChange> selectMoneyChangeList(MoneyChange moneyChange);
	
	/**
     * 新增资金变动
     * 
     * @param moneyChange 资金变动信息
     * @return 结果
     */
	public int insertMoneyChange(MoneyChange moneyChange);
	
	/**
     * 修改资金变动
     * 
     * @param moneyChange 资金变动信息
     * @return 结果
     */
	public int updateMoneyChange(MoneyChange moneyChange);
		
	/**
     * 删除资金变动信息
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	public int deleteMoneyChangeByIds(String ids);

	//查询分润返佣明细  返回定义明细Vo   旧订单
    List<MoneyChangeVo> selectMoneyChangeVoList(MoneyChangeVo moneyChangeVo);

    //申请体现列表
    List<MoneyChange> applyMoneyList(MoneyChange moneyChange);

    //app端公告列表
    AjaxResult selectMoneyChangeListByWhere();



	//app端利润:返回今日利润  昨日利润的总额，本月分润总额
	AjaxResult selectTodayProfitByMerchantId(String merchantNo);

	//app端今日或昨日利润列表
	AjaxResult profitDetails(String merchantNo, String type,Integer pageNum,Integer pageSize);

    //app端 提现记录
    AjaxResult selectCashWithdrawalList(String merchantId,Integer pageNum,Integer pageSize);

    //app端 根据月份统计利润：刷卡/办卡/贷款
	AjaxResult selectProfitByMonth(String merchantNo, String merchantId, String month);

	//分享 ：收益详情列表
    AjaxResult selectProfitDetailsList(String merchantId, String merchantNo, String searchMonth, Integer pageNum, Integer pageSize);

    AjaxResult selectProfitDetailsListByShopping(String merchantId, String merchantNo, String searchMonth, Integer pageNum, Integer pageSize);


	/**
	 * 后台订单分润交易流水
	 * @param moneyChangeVo
	 * @return
	 */
	List<MoneyChangeNewOederVo> selectMoneyChangeVoListByNewOrder(MoneyChangeNewOederVo moneyChangeVo);

	/**
	 * 后台统计分润金额 和笔数
	 * @param moneyChangeVo
	 * @return
	 */
    Map<String, Object> selectCountMoneyChange(MoneyChangeNewOederVo moneyChangeVo);

	/**
	 * 后台升级分润列表
	 * @param upgradeVo
	 * @return
	 */
    List<MoneyChangeNewOederVo> selectMoneyChangeVoListByUpgrade(MoneyChangeNewOederVo upgradeVo);

	/**
	 * 后台统计升级的分润笔数和金额
	 * @param upgradeVo
	 * @return
	 */
	Map<String, Object> selectCountMoneyChangeByUpgrade(MoneyChangeNewOederVo upgradeVo);

	//根据用户id 和分润类型统计总金额
    BigDecimal selectTotalByMerchantIdAndMoneyType(String merchantId, String moneyType );

	AjaxResult profitDetailsByShopping(String merchantNo, String type, Integer pageNum, Integer pageSize);

    AjaxResult selectProfitList(String type, Integer pageNum, Integer pageSize,String merchantId);

	public void commissions(String id, Integer orderType, BigDecimal amountMoney, String merchantId, BigDecimal profitMoney);


	/**
	 * 积分明细列表 商城积分兑换/充值分润
	 * @param merchantId
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
    AjaxResult selectShoppingScoreList(String merchantId, Integer pageNum, Integer pageSize);

	/**
	 * 积分兑换成功 》详情
	 * @param merchantId
	 * @param orderId
	 * @return
	 */
	AjaxResult shoppingExchangeCashDetails(String merchantId, String orderId);
	/**
	 * 提现收益
	 * @param paymentOrder
	 */
	public void withdrawal(PaymentOrder paymentOrder);

	public AjaxResult newProfitList(Integer pageNum, Integer pageSize, String merchantId, String time, String timeEnd);

	public List<MoneyChange> selectListByMoneyTypeAndStutas(String merchantId, String moneyType, String status);
}
